﻿using Microsoft.Phone.Controls;
using MyMeetup.ViewModels;

namespace MyMeetup
{
    /// <summary>
    /// Description for RateItPage.
    /// </summary>
    public partial class RateItPage : PhoneApplicationPage
    {
        private RateItViewModel _viewModel;

        /// <summary>
        /// Initializes a new instance of the RateItPage class.
        /// </summary>
        public RateItPage()
        {
            InitializeComponent();
        }

        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            string title;
            string eventId;

            NavigationContext.QueryString.TryGetValue("title", out title);
            NavigationContext.QueryString.TryGetValue("eventId", out eventId);

            _viewModel = this.DataContext as RateItViewModel;
            _viewModel.PageName = title;
            _viewModel.EventId = eventId;
            DataContext = _viewModel;
        }
    }
}